package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {

        People[] persons = new People[3];
        persons[0] = new People("张三", 18, '男', new String[]{"中国", "美国"});
         persons[1] = new People("张三", 18, '男', new String[]{"中国", "美国"});
         persons[2] = new People("张三", 18, '男', new String[]{"中国", "美国"});
        FileOutputStream fos = new FileOutputStream("peoson.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(persons);
        System.out.println("输出完毕");
        fos.close();

    }
}
